<%--
    Document   : sun
    Created on : Jun 4, 2010, 8:09:44 PM
    Author     : Lakshmi Narayanan
--%>
<%@tag description="put the tag description here" pageEncoding="UTF-8"%>
<%@taglib tagdir="/WEB-INF/tags/hunk/" prefix="hunk"%>
<%@taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%@taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html"%>
<%@attribute name="name" required="true"%>
<%@attribute name="label"%>
<%@attribute name="value"%>
<%@attribute name="query"%>
<%@attribute name="collections"%>
<%@attribute name="style"%>
<%@attribute name="styleClass"%>
<%@attribute name="container"%>
<%@attribute name="tooltip"%>
<%@attribute name="indexProperty"%>
<%@attribute name="valueProperty"%>

<c:if test="${not empty label}">
    <label>${label}</label>
</c:if>

<html:select property="${name}" name="${form}" style="${style}" styleClass="${styleClass}" styleId="${name}">

    <c:if test="${empty valueProperty || empty indexProperty}">
        <html:optionsCollection name="${collections}"/>
    </c:if>
    <c:if test="${not empty valueProperty &&  not empty indexProperty}">
        <html:optionsCollection name="${collections}" label="${valueProperty}" value="${indexProperty}"/>
    </c:if>

</html:select>